package com;

import java.util.Scanner;

/**
 * @author yinmage
 * @date 2022/08/03
 */
public class Start {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        while (true) {
            System.out.println(menu);
            String item = scanner.nextLine();
            switch (item) {
                case "0":
                    return;
                case "1":
                    Execute.executeRandom();
                    break;
                case "2":
                    Execute.executePolling();
                    break;
                case "3":
                    Execute.weightedRandom();
                    break;
                case "4":
                    Execute.weightedPolling();
                    break;
                default:
                    System.out.println("输入错误，请重新输入！");
                    break;
            }

        }
    }

    public static String menu =
        "===============================\n"
            + "请输入选项\n"
            + "===============================\n"
            + "1:随机获取\n"
            + "2:轮询获取\n"
            + "3:加权随机\n"
            + "4:平滑加权轮询\n"
            + "\n"
            + "0:退出\n"
            + "===============================\n\n";
}
